package com.zsqat.eshop.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zsqat.common.utils.PageUtils;
import com.zsqat.eshop.member.entity.MemberEntity;
import com.zsqat.eshop.member.exception.PhoneException;
import com.zsqat.eshop.member.exception.UserNameException;
import com.zsqat.eshop.member.vo.MemberUserLoginVo;
import com.zsqat.eshop.member.vo.MemberUserRegisterVo;
import com.zsqat.eshop.member.vo.SocialUser;

import java.util.Map;

/**
 * 会员
 *
 * @author zsqat
 * @email 491192853@qq.com
 * @date 2020-11-19 15:35:47
 */
public interface MemberService extends IService<MemberEntity> {
  PageUtils queryPage(Map<String, Object> params);

  /**
   * 用户注册
   * @param memberUserRegisterVo
   */
  void register(MemberUserRegisterVo memberUserRegisterVo);

  /**
   * 判断手机号码是否重复
   * @param phone
   * @return
   */
  void checkPhoneUnique(String phone) throws PhoneException;

  /**
   * 判断用户名是否重复
   * @param userName
   * @return
   */
  void checkUserNameUnique(String userName) throws UserNameException;

  /**
   * 用户登录
   * @param memberUserLoginVo
   * @return
   */
  MemberEntity login(MemberUserLoginVo memberUserLoginVo);

  /**
   * 社交用户的登录
   * @param socialUser
   * @return
   */
  MemberEntity login(SocialUser socialUser) throws Exception;

  /**
   * 微信登录
   * @param accessTokenInfo
   * @return
   */
  MemberEntity login(String accessTokenInfo);
}

